<template>
	<view class="index">

		<index-header bgColor="bg-index-header" @headerSwitch="headerSwitch"/>

		<!-- 视频组件 -->
		<cu-video class="video" :video_list="videoList"/>

	</view>
</template>

<script>
	import indexHeader from '@/components/index-header/index-header.vue';
	import cuVideo from '@/components/cu-video/cu-video.vue';
	export default {
		components: {
			indexHeader,
			cuVideo
		},
		
		data() {
			return {
				title: 'Hello',
				videoList:[
					// video_id: '728292467', // 视频id
					// nickname: '测试',// 视频名
					// video_describe: '描述信息', // 视频描述
					// cover_url: "https://p9-pc-sign.douyinpic.com/tos-cn-p-0015/owh9JE57PQ4VaSHqAH5DaC7sfC20KfBIHVAeBJ~tplv-dy-resize-origshort-autoq-75:330.jpeg?x-expires=2011183200&x-signature=S5zH4X7iy31blSISLQq%2FHt0PBpM%3D&from=3213915784&s=PackSourceEnum_FEED&se=false&sc=cover&biz_tag=pcweb_cover&l=20230927222855E0F3875CF31C8F171FB0", // 视频封面
					// video_url: 'http://vd3.bdstatic.com/mda-pis2b6dk3t0w0kjg/cae_h264/1695779281983904447/mda-pis2b6dk3t0w0kjg.mp4', // 视频链接
					// dianzan: 100,// 视频点赞数
					// pinglun: 200, // 视频评论
					// zhuanfa: 124123,// 视频转发
					// is_dianzan: true, // 是否点赞过该视频
					// flag: false // 是否自动播放
					{
						"video_id": "4130603721346799427",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"publish_time": 1694154722,
						"publish_time_text": "09月08日",
						"time_length": "01:50",
						"nickname": "洋子说动物",
						"dianzan": "585万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/a3dc4892-4e11-11ee-a9c4-6c92bf28c003.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: true, // 是否点赞过该视频
						flag: false // 是否自动播放
					},
					{
						"video_id": "10982387683587608278",
						"video_describe": "巴基斯坦小男孩为什么会给印度士兵水喝？看到真相后，被感动了",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"poster_webp": "https://f7.baidu.com/it/u=227857989,3448750862&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"poster_img": "https://f7.baidu.com/it/u=227857989,3448750862&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"publish_time": 1694155797,
						"publish_time_text": "09月08日",
						"time_length": "02:48",
						"nickname": "西呱豆丁",
						"dianzan": "28万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/fe3acf14-4e13-11ee-9290-6c92bf7e98d4.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: false, // 是否点赞过该视频
						flag: false // 是否自动播放
					},
					{
						"video_id": "5617248491820438492",
						"video_describe": "听闻儿子被陈赓枪毙，龙云怒闯中南海，毛主席道：你回云南看看",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"poster_webp": "https://f7.baidu.com/it/u=4241532674,472492850&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"poster_img": "https://f7.baidu.com/it/u=4241532674,472492850&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"publish_time": 1691994006,
						"publish_time_text": "08月14日",
						"time_length": "09:28",
						"nickname": "文林小姐说",
						"dianzan": "61万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/afb2d3a8-3a6a-11ee-a081-6c92bf3a2c89.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: false, // 是否点赞过该视频
						flag: false // 是否自动播放
					},
					{
						"video_id": "9431861427955646385",
						"video_describe": "发明汽车差速器的人真的是天才，你知道差速器的工作原理吗？",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"poster_webp": "https://f7.baidu.com/it/u=3618392697,1901029976&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"poster_img": "https://f7.baidu.com/it/u=3618392697,1901029976&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"publish_time": 1694423733,
						"publish_time_text": "09月11日",
						"time_length": "01:45",
						"nickname": "科探声音",
						"dianzan": "42万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/0317e8c6-5078-11ee-95f6-6c92bf627a57.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: false, // 是否点赞过该视频
						flag: false // 是否自动播放
					},
					{
						"video_id": "10625890167557243021",
						"video_describe": "最痛恨日本的国家，扬言炸沉日本岛！却遭打压彻底消失在历史中？",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"poster_webp": "https://f7.baidu.com/it/u=3416824324,2580053270&fm=222&app=106&f=PNG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"poster_img": "https://f7.baidu.com/it/u=3416824324,2580053270&fm=222&app=106&f=PNG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"publish_time": 1690278339,
						"publish_time_text": "07月25日",
						"time_length": "05:53",
						"nickname": "大圣漫谈",
						"dianzan": "39万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/d1e21078-2c33-11ee-9d81-6c92bf402885.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: false, // 是否点赞过该视频
						flag: false // 是否自动播放
					},
					{
						"video_id": "5285106155354050232",
						"video_describe": "当双胞胎妹妹突然倒下，姐姐看了一眼，接下来的举动太逗了",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"poster_webp": "https://f7.baidu.com/it/u=3924232153,2443297675&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"poster_img": "https://f7.baidu.com/it/u=3924232153,2443297675&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"publish_time": 1695387227,
						"publish_time_text": "5天前",
						"time_length": "01:29",
						"nickname": "嘟啦日记解说",
						"dianzan": "37万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/242e0ee6-5947-11ee-8a2b-7cd30a5c8ff8.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: false, // 是否点赞过该视频
						flag: false // 是否自动播放
					},
					{
						"video_id": "7739932337488438034",
						"video_describe": "影视：小伙被鬼子追杀，立马躲进少奶奶家避难，谁料还白捡个媳妇",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"poster_img": "https://f7.baidu.com/it/u=955016388,2405369344&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"publish_time": 1687175772,
						"publish_time_text": "06月19日",
						"time_length": "07:28",
						"nickname": "好剧享不完",
						"dianzan": "23万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/11f30a7c-0e99-11ee-a78d-6c92bf5ceabd.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: false, // 是否点赞过该视频
						flag: false // 是否自动播放
					},
					{
						"video_id": "3258765909631254336",
						"video_describe": "遥控器坏了别扔，大部分都是这里问题，用一个打火机自己就能修好",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"poster_webp": "https://f7.baidu.com/it/u=1629231515,540926154&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"poster_img": "https://f7.baidu.com/it/u=1629231515,540926154&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"publish_time": 1692961130,
						"publish_time_text": "08月25日",
						"time_length": "03:19",
						"nickname": "我爱电器维修",
						"dianzan": "31万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/7098b87e-4337-11ee-82e9-7cd30a602444.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: false, // 是否点赞过该视频
						flag: false // 是否自动播放
					},
					{
						"video_id": "635890244483416814",
						"video_describe": "为什么俄罗斯专家建议，用氢弹爆炸来中和日本核污染水？",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"poster_webp": "https://f7.baidu.com/it/u=4187101500,2332090505&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"poster_img": "https://f7.baidu.com/it/u=4187101500,2332090505&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"publish_time": 1693559498,
						"publish_time_text": "09月01日",
						"time_length": "04:27",
						"nickname": "科学打字机",
						"dianzan": "132万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/541b0884-48a8-11ee-b3ef-7cd30ac119bd.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: false, // 是否点赞过该视频
						flag: false // 是否自动播放
					},
					{
						"video_id": "7382940279709110525",
						"video_describe": "台海形势已到转折时期，汉奸蔡英文和朱立伦，都必须被斩草除根",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"poster_webp": "https://f7.baidu.com/it/u=786421112,1888995127&fm=222&app=106&f=PNG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"poster_img": "https://f7.baidu.com/it/u=786421112,1888995127&fm=222&app=106&f=PNG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"publish_time": 1695449465,
						"publish_time_text": "4天前",
						"time_length": "03:29",
						"nickname": "竡年档案",
						"dianzan": "63万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/7cff230c-59d8-11ee-a647-6c92bfb3fd7e.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: false, // 是否点赞过该视频
						flag: false // 是否自动播放
					},
					{
						"video_id": "5049290387784271169",
						"video_describe": "原来饭店的藕丝是这样切的，难怪又均匀又细还不断，长见识了",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"poster_webp": "https://f7.baidu.com/it/u=1253295905,2063432164&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"poster_img": "https://f7.baidu.com/it/u=1253295905,2063432164&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"publish_time": 1693894652,
						"publish_time_text": "09月05日",
						"time_length": "01:53",
						"nickname": "阿云厨艺",
						"dianzan": "91万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/74b15666-4bb4-11ee-8236-6c92bf468151.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: false, // 是否点赞过该视频
						flag: false // 是否自动播放
					},
					{
						"video_id": "10458363705652687585",
						"video_describe": "姐夫离婚后，小姨子天天来姐夫家蹭饭，理由太逗了",
						"cover_url": "https://i.postimg.cc/XXMhJBWZ/logo.png",
						"poster_webp": "https://f7.baidu.com/it/u=3076818904,31258905&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"poster_img": "https://f7.baidu.com/it/u=3076818904,31258905&fm=222&app=106&f=JPEG?x-bce-process=image/quality,q_100/resize,m_fill,w_480,h_270/format,f_auto",
						"publish_time": 1691208192,
						"publish_time_text": "08月05日",
						"time_length": "02:59",
						"nickname": "谷哥喜剧",
						"dianzan": "110万",
						"video_url": "https://highlight-video.cdn.bcebos.com/video/6s/6470e3d4-3345-11ee-8c26-6c92bf47fd81.mp4",
						pinglun: 200, // 视频评论
						is_dianzan: false, // 是否点赞过该视频
						flag: false // 是否自动播放
					}
				]
			}
		},
		onLoad() {
			this.getVideoList();
		},
		onShow() {
			console.log('界面显示')
		},
		onShareAppMessage() {
			return {
				title: '宝 藏 库',
				path: '/videoPackge/index/index'
			}
		},
		methods: {

			getVideoList(refresh) {
				// uni.request({
				// 	url: 'https://api.52170.xin/video',
				// 	dataType: 'json',
				// 	success: res => {
				// 		console.log(res.data.data.list);
				// 		for (let item of res.data.data.list) {
				// 			this.videoList.push({
				// 				vvideo_id: item.vvideo_id,
				// 				nickname: item.nickname,
				// 				video_describe: item.video_describe,
				// 				cover_url: item.cover_url,
				// 				video_url: item.video_url,
				// 				dianzan: item.dianzan,
				// 				pinglun: item.pinglun,
				// 				zhuanfa: item.zhuanfa,
				// 				is_dianzan: item.is_dianzan,
				// 				flag: false
				// 			});
				// 		}

				// 	}
				// });
			},
			// 顶部切换
			headerSwitch(val){
				// console.log(val);
				this.getVideoList();
			}
			
			
			
			
		}
		
	}
</script>

<style lang="scss" scoped>
	@import "@/colorui/main.css";
	@import "@/colorui/icon.css";
	.index {
		display: flex;
		flex-direction: column;
		/* align-items: center; */
		justify-content: center;
		background-color: #333333;
		// height: 100vh;
	}
	.tabbar{
		.action{
			.plus{
				image{
					width: 100upx;
					height: 60upx;
				}
			}
		}
	}
</style>
